/**
 * 
 */
package fhq.hcmute.modernshopping.fragment;

import fhq.hcmute.modernshopping.R;
import android.app.AlertDialog;
import android.app.Dialog;
import android.app.DialogFragment;
import android.content.DialogInterface;
import android.content.DialogInterface.OnClickListener;
import android.os.Bundle;

/**
 * @author: Hien Nguyen Le
 * @emai: hien.nguyenle.it@gmail.com
 * 
 */
public class MyDialog extends DialogFragment {
	private static final String KEY = "DIALOG_KEY";

	static MyDialog newInstance(String title) {
		MyDialog dialog = new MyDialog();
		Bundle bundle = new Bundle();
		bundle.putString(KEY, title);
		dialog.setArguments(bundle);
		return dialog;
	}

	@Override
	public Dialog onCreateDialog(Bundle savedInstanceState) {
		String title = getArguments().getString(KEY);
		AlertDialog.Builder builder = new AlertDialog.Builder(getActivity());
		builder.setTitle(getString(R.string.drawer_comments))
				.setNegativeButton(getString(R.string.btn_close),
						onCancelClickListener);
		builder.setMessage(title);
		return builder.create();
	}

	private OnClickListener onCancelClickListener = new OnClickListener() {

		@Override
		public void onClick(DialogInterface dialog, int which) {

		}
	};
}
